package cn.neusoft.baibang.exception;

public class GlobalException extends RuntimeException {
    /*定义异常码*/
    private String errorCode;
    /*异常信息*/
    private String message;


    public GlobalException() {
        super();
    }

    public GlobalException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
        this.message = message;
    }

    public GlobalException(GlobaExceptionEnum globaExceptionEnum) {
        super(globaExceptionEnum.getMessage());
        this.errorCode = globaExceptionEnum.getCode();
        this.message = globaExceptionEnum.getMessage();
    }

    public String getErrorCode() {
        return errorCode;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
